using System.Threading.Tasks;
using System.Collections.Generic;
using CoreApp.DBModel;

namespace CoreApp.DBAccess
{
    /// <summary>
    /// 用户类仓库
    /// </summary>
    /// <typeparam name="UserInfo"></typeparam>
    public interface IUserRepository : IRepositoryBase<UserInfo>
    {
        /// <summary>
        /// 插入
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<int> InsertUser(UserInfo entity);        

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        Task<int> DeleteUserById(int Id);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<int> UpdateUser(UserInfo entity);

        /// <summary>
        /// 获取用户
        /// </summary>
        /// <param name="name">用户名</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        Task<UserInfo> QueryUser(string name, string pwd);

        /// <summary>
        /// 获取用户列表--异步
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        Task<List<UserInfo>> GetUserListAsnync(string name);

        /// <summary>
        /// 获取用户列表--同步
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        List<UserInfo> GetUserList(string name);

        Task<List<UserInfo>> GetUserByProc(string procName, Dictionary<string, string> dic);
    }
}